<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="${pageContext.request.contextPath}/statics/css/common.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/statics/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="wrap">
  <c:if test="${!empty auctionList}">
<!-- main begin-->
  <div class="sale">
    <h1 class="lf">拍卖结束的商品</h1>
    <div class="right rulse">当前用户是：<span class="blue strong">${auctionUserSession.userName}</span></div>
    <div class="cl"></div>
  </div>
<div class="items">
      <ul class="rows even strong">
        <li>名称</li>
        <li>开始时间</li>
        <li>结束时间</li>
        <li>起拍价</li>
        <li class="list-wd">成交价</li>
        <li class="borderno">买家</li>
      </ul>
      <c:forEach items="${auctionList}" var="end" varStatus="status">
	      <ul class="rows" <c:if test="${status.index % 2 == 1}">style="background: #EBF6FA" </c:if>>
	        <li>${end.auctionName }</li>
	        <li><fmt:formatDate value="${end.auctionStartTime }" pattern="yyyy-MM-dd HH:mm:ss"/> </li>
	        <li><fmt:formatDate value="${end.auctionEndTime}" pattern="yyyy-MM-dd HH:mm:ss"/></li>
	        <li>${end.auctionStartPrice }</li>
              <c:if test="${end.moneyMax <= 0}">
                  <li class="list-wd">商品流拍</li>
              </c:if>
              <c:if test="${end.moneyMax > 0}">
                  <li class="list-wd">${end.moneyMax }</li>
              </c:if>
            <li class="borderno red">${end.userName}</li>
          </ul>
   	  </c:forEach>
  </div>
  </c:if>
  
  <c:if test="${not empty aList}">
  <h1>拍卖中的商品</h1>
  <div class="items records">
      <ul class="rows even strong rowh"> 
        <li>名称</li>
        <li>开始时间</li>
        <li>结束时间</li>
        <li>起拍价</li>
        <li class="borderno record">出价记录</li>
        <div class="cl"></div>
      </ul>
      	<c:forEach items="${aList}" var="notend" varStatus="status">
    <ul class="rows" <c:if test="${status.index % 2 == 1}">style="background: #EBF6FA" </c:if>>
        <li>${notend.auctionName }</li>
        <li><fmt:formatDate value="${notend.auctionStartTime }" pattern="yyyy-MM-dd HH:mm:ss"/></li>
        <li><fmt:formatDate value="${notend.auctionEndTime }" pattern="yyyy-MM-dd HH:mm:ss"/></li>
        <li>${notend.auctionStartPrice }</li>
        <li class="borderno blue record">
        	<c:forEach items="${notend.record }" var="record">
          		<p>${record.userName }&nbsp;&nbsp; ${record.auctionPrice }元</p>
          	</c:forEach>
        </li>
        <div class="cl"></div>
      </ul>
   		</c:forEach>
  </div>
</c:if>
    <div class="top10">
        <input name="" type="button" value="刷 新" onclick="javascript:location.reload()" />
        <input name="" type="button" value="返回列表" class="" onclick="javascript:location='${pageContext.request.contextPath}/SrecordList'"/>
    </div>
<!-- main end-->
</div>
</body>
</html>